package org.example.controller.bi;

import jakarta.annotation.Resource;
import org.example.domain.Result;
import org.example.domain.bi.InterfaceTypes;
import org.example.mapper.InterfaceTypesMapper;
import org.example.mapper.InterfacesMapper;
import org.springframework.web.bind.annotation.*;

/**
 * @description:
 * @Author: whopxx
 * @CreateTime: 2025-01-06
 */
@RestController
@RequestMapping("/interfaceTypes")
public class InterfaceTypesController {
    @Resource
    private InterfaceTypesMapper interfaceTypesMapper;

    @GetMapping("/list")
    public Result list() {
        return Result.success(interfaceTypesMapper.selectList(null));
    }

    @PostMapping
    public Result add(@RequestBody InterfaceTypes interfaceTypes) {
        interfaceTypesMapper.insert(interfaceTypes);
        return Result.success();
    }


    @PutMapping
    public Result update(@RequestBody InterfaceTypes interfaceTypes) {
        interfaceTypesMapper.updateById(interfaceTypes);
        return Result.success();
    }

    @DeleteMapping
    public Result delete(@RequestParam Integer id) {
        interfaceTypesMapper.deleteById(id);
        return Result.success();
    }


}
